package com.wsoft.system.manager;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wsoft.constant.redis.RedisKeyConstant;
import com.wsoft.core.annotation.GetRedisCache;
import com.wsoft.core.utils.SqlAuthDisableHolder;
import com.wsoft.system.entity.SysOrganizationEntity;
import com.wsoft.system.mapper.SysOrganizationMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zgk
 * @date 2025/3/20 8:37
 * @description:
 */
@Service
public class SysOrganizationManager extends ServiceImpl<SysOrganizationMapper, SysOrganizationEntity> {
    @GetRedisCache(type = RedisKeyConstant.CACHE_TYPE_ALL_DEPT,
            value = RedisKeyConstant.REDIS_NULL)
    public List<SysOrganizationEntity> listAllOrgWithCache() {
        SqlAuthDisableHolder.open();
        List<SysOrganizationEntity> list = list();
        SqlAuthDisableHolder.close();
        return list;
    }
}
